//
//  WriteText.m
//  MyChatchat
//
//  Created by 小灰灰的pro on 16/3/29.
//  Copyright © 2016年 小灰灰. All rights reserved.
//

#import "WriteText.h"

@implementation WriteText

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self initLayout];
    }
    return self;
}

- (void)initLayout{
    self.aView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 64)];
    self.aView.backgroundColor = [UIColor blackColor];
    [self addSubview:self.aView];
    self.leftButton = [UIButton buttonWithType:UIButtonTypeSystem];
    self.leftButton.frame = CGRectMake(10, 27, 40, 20);
    [self.leftButton setTitle:@"取消" forState:UIControlStateNormal];
    [self.leftButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.aView addSubview:self.leftButton];
    self.rightButton = [UIButton buttonWithType:UIButtonTypeSystem];
    self.rightButton.frame = CGRectMake([UIScreen mainScreen].bounds.size.width - 60, 27, 40, 20);
    [self.rightButton setTitle:@"发送" forState:UIControlStateNormal];
    [self.rightButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.aView addSubview:self.rightButton];
    
    self.textLabel = [[UILabel alloc] initWithFrame:CGRectMake(([UIScreen mainScreen].bounds.size.width - 80)/2 , 27, 80, 20)];
    self.textLabel.text = @"发表文字";
    self.textLabel.textColor = [UIColor whiteColor];
    [self.aView addSubview:self.textLabel];
    
    self.textView = [[UITextView alloc] initWithFrame:CGRectMake(10, 74, [UIScreen mainScreen].bounds.size.width - 20, 300) textContainer:nil];
    self.textView.scrollEnabled = NO;
    self.textView.font = [UIFont systemFontOfSize:15];
    [self addSubview:self.textView];
}

@end
